package com.reinto.wallpaper.test;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.InputMultiplexer;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.ui.Skin;

public class AbstractScreen implements Screen {
    protected final TestWallpaper game;
    protected final SpriteBatch batch;
    protected Stage stage;

    public InputMultiplexer multiplexer;

    public float wRatio;
    public float hRatio;

    private Skin skin;

    public AbstractScreen(TestWallpaper game) {
        this.game = game;
        // nastavime font

        this.batch = new SpriteBatch();
        this.stage = new Stage(0,0,true);

        wRatio = Gdx.graphics.getWidth() / 480f;
        hRatio = Gdx.graphics.getHeight() / 800f;
    }

    @Override
    public void show()
    {
    }

    @Override
    public void resize(
            int width,
            int height )
    {
        stage.setViewport(width, height, true);
    }

    @Override
    public void render(
            float delta )
    {
        // the following code clears the screen with the given RGB color (black)
        Gdx.gl.glClearColor(255,255,255,1);
        Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT );

        stage.act(delta);
        stage.draw();
    }

    @Override
    public void hide()
    {
    }

    @Override
    public void pause()
    {
    }

    @Override
    public void resume()
    {
    }

    @Override
    public void dispose()
    {
        batch.dispose();
    }
}